package com.wechat.weather.task;

import com.wechat.weather.service.MessageService;
import com.wechat.weather.util.WxUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author: xiaojiahui@dtxytech.com
 * @since: 2024-12-09  14:55
 * @Description: TODO
 */
@Configuration //1.标记配置类
//@EnableScheduling //2.开启定时任务
public class StaticScheduleTask {

    @Autowired
    private MessageService messageService;

    //3.添加定时任务
    @Scheduled(cron = "0 30 7 ? * *")
    public void Scheduled() {
        messageService.sendMessage(WxUtil.loveDate);

    }
}
